gint height,
gboolean is_geometry);
-static void update_themed_icon (GtkIconTheme *theme,
- GtkWindow *window);
+static void update_themed_icon (GtkWindow *window);
static GList *icon_list_from_theme (GtkWindow *window,
const gchar *name);
static void gtk_window_realize_icon (GtkWindow *window);
gint width,
gint *minimum_size,
gint *natural_size);
+static void gtk_window_style_updated (GtkWidget *widget);
static void gtk_window_state_flags_changed (GtkWidget *widget,
GtkStateFlags previous_state);
widget_class->get_preferred_height = gtk_window_get_preferred_height;
widget_class->get_preferred_height_for_width = gtk_window_get_preferred_height_for_width;
widget_class->state_flags_changed = gtk_window_state_flags_changed;
+ widget_class->style_updated = gtk_window_style_updated;
container_class->remove = gtk_window_remove;
container_class->check_resize = gtk_window_check_resize;
if (info->using_themed_icon)
{
- GtkIconTheme *icon_theme;
-
g_list_free_full (icon_list, g_object_unref);
-
- icon_theme = gtk_css_icon_theme_value_get_icon_theme
- (_gtk_style_context_peek_property (gtk_widget_get_style_context (GTK_WIDGET (window)),
- GTK_CSS_PROPERTY_ICON_THEME));
- g_signal_connect (icon_theme, "changed",
- G_CALLBACK (update_themed_icon), window);
}
}
if (info == NULL)
return;
- if (info->using_themed_icon)
- {
- GtkIconTheme *icon_theme;
-
- icon_theme = gtk_css_icon_theme_value_get_icon_theme
- (_gtk_style_context_peek_property (gtk_widget_get_style_context (GTK_WIDGET (window)),
- GTK_CSS_PROPERTY_ICON_THEME));
-
- g_signal_handlers_disconnect_by_func (icon_theme, update_themed_icon, window);
- }
-
/* We don't clear the properties on the window, just figure the
* window is going away.
*/
static void
-update_themed_icon (GtkIconTheme *icon_theme,
- GtkWindow *window)
+update_themed_icon (GtkWindow *window)
{
g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_ICON_NAME]);
g_list_free_full (info->icon_list, g_object_unref);
info->icon_list = NULL;
- update_themed_icon (NULL, window);
+ update_themed_icon (window);
g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_ICON_NAME]);
}
gtk_css_node_set_state (priv->decoration_node, state);
}
+static void
+gtk_window_style_updated (GtkWidget *widget)
+{
+ const GtkBitmask *changes = _gtk_style_context_get_changes (gtk_widget_get_style_context (widget));
+
+ GTK_WIDGET_CLASS (gtk_window_parent_class)->style_updated (widget);
+
+ if (changes == NULL || _gtk_bitmask_get (changes, GTK_CSS_PROPERTY_ICON_THEME))
+ update_themed_icon (GTK_WINDOW (widget));
+}
+
/**
* _gtk_window_unset_focus_and_default:
* @window: a #GtkWindow